package com.liaoban.app.ui.message;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.liaoban.app.R;
import com.liaoban.app.adapter.NoticeAdapter;
import com.liaoban.app.api.type.Notice;
import com.liaoban.app.biz.CommonBiz;
import com.liaoban.app.ui.base.BaseListActivity;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * Created by ybc on 2018/7/27 0027.
 * 通知
 */
public class NoticeActivity extends BaseListActivity<Notice> {
    @BindView(R.id.iv_right)
    ImageView ivRight;

    @Override
    public String getNewTitle() {
        return "通知";
    }

    @Override
    public BaseQuickAdapter getAdapter() {
        return new NoticeAdapter(null);
    }

    @Override
    public void itemChildClick(BaseQuickAdapter baseQuickAdapter, View view, int position) {

    }

    @Override
    public void itemClick(BaseQuickAdapter baseQuickAdapter, View view, int position) {

    }

    @Override
    public void getData() {
        startTask(CommonBiz.getInstance().messageList(),listBaseResponse -> {
            doSuc(listBaseResponse.data, listBaseResponse.totalPageCount);
        });
    }

    @Override
    protected void initView(Bundle savedInstanceState) {
        super.initView(savedInstanceState);
        ivRight.setImageResource(R.mipmap.ic_home_sound);
        ivRight.setVisibility(View.VISIBLE);
    }

    @OnClick(R.id.iv_right)
    public void right() {
        startActivity(new Intent(this, CallHistoryActivity.class));
    }
}
